package com.air.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.air.mapper.UserMapper;
import com.air.domain.User;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

/**
 * @author shent
 */
@Service
@Transactional
public class UserService extends ServiceImpl<UserMapper, User> {
    @Autowired
    UserMapper userMapper;

    public long register(User user) {
        user.setCreateTime(new Date());
        userMapper.insert(user);
        return user.getId();
    }
}
